﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace T.FAS.Runtime.Metadata.Entity.DataModel
{
    /// <summary>
    /// 关联项
    /// </summary>
    [Serializable]
    public class AssociateItem //: SystemBase
    {
        /// <summary>
        /// ID
        /// </summary>
        public string ID { get; set; }

        /// <summary>
        /// 来源节点对象元素ID
        /// 当外键关联时，代表当前节点的外键元素（CNO.Ele）ID
        /// 当主子关联时，代表当前节点的外键元素（CNO.Ele）ID
        /// </summary>       
        public string SourceElementID { get; set; }

        /// <summary>
        /// 目的节点对象元素ID
        /// 当外键关联是，代表外键关联DO的主键列（DataColumn）ID
        /// 当主子关联时，代表父级节点的主键元素（CNO.Ele）ID
        /// </summary>        
        public string TargetElementID { get; set; }

        /// <summary>
        /// 隶属的关联ID
        /// </summary>
        [JsonIgnore]
        public string AssociationID { get; set; }

        /// <summary>
        /// 领域模型ID
        /// </summary>
        [JsonIgnore]
        public string CompositeDataObjectID { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        //[DataMember]
        [JsonIgnore]
        public string Creator { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>        
        //[DataMember]
        [JsonIgnore]
        public DateTime CreateTime { get; set; }

        /// <summary>
        /// 最后修改人
        /// </summary>
        //[DataMember]
        [JsonIgnore]
        public string LastModifier { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>        
        //[DataMember]
        [JsonIgnore]
        public DateTime LastModifyTime { get; set; }

        /// <summary>
        /// 构造函数
        /// </summary>
        public AssociateItem() { }

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="sourceElementID">源节点对象元素ID</param>
        /// <param name="targetElementID">目标节点对象元素ID</param>
        public AssociateItem(string sourceElementID, string targetElementID)
            : this()
        {
            SourceElementID = sourceElementID;
            TargetElementID = targetElementID;
        }
    }
}
